package cn.bld.service;

import cn.bld.entity.StorageRecord;
import cn.bld.entity.SysRole;
import cn.bld.entity.SysSupplier;
import cn.bld.mapper.SysSupplierMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SysSupplierServiceImpl implements SysSupplierService {
    @Autowired
    private SysSupplierMapper sysSupplierMapper;
    @Override
    public List<SysRole> findall() {
        return sysSupplierMapper.findall();
    }

    @Override
    public Integer findCount(String supCode, String supName) {
        return sysSupplierMapper.findCount(supCode, supName);
    }

    @Override
    public List<SysSupplier> findByCondition(String supCode, String supName, Integer pageNo, Integer size) {
        int offset=(pageNo-1)*size;
        return sysSupplierMapper.findByCondition(supCode, supName, offset, size);
    }

    @Override
    public int insertSupplier(SysSupplier sysSupplier) {
        return sysSupplierMapper.insertSupplier(sysSupplier);
    }

    @Override
    public int checkSupCode(String supCode) {
        return sysSupplierMapper.checkSupCode(supCode);
    }

    @Override
    public int deleteSupplier(Integer supId) {
        return sysSupplierMapper.deleteSupplier(supId);
    }

    @Override
    public SysSupplier findById(Integer id) {
        return sysSupplierMapper.findById(id);
    }
    @Override
    public int updateSupplier(SysSupplier sysSupplier) {
        return sysSupplierMapper.updateSupplier(sysSupplier);
    }
}
